package top.humbleyuan.test.qushi;

import java.util.Scanner;

/**
 * @Author HumbleYuan
 * @Date 2020/5/9 18:39
 * @Des
 */
public class QuShiExamDemo {

    public static void main(String[] args) {
        // 负数的取余和取模
        m1();

        //m2();

    }

    private static void m2() {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNext()) {
            String s = sc.nextLine();
            String res = "";

            String sch = "";

            // schema
            String schema = s.substring(0, 4);
            if(schema.equals("http")) {
                if(s.charAt(4) == 's') {
                    sch = "https";
                    s = s.substring(8);
                } else {
                    sch = "http";
                    s = s.substring(7);
                }
            } else {
                sch = "http";
            }

            // host,划分到第一个/
            int index = s.indexOf("/");
            String host = s.substring(0, index);
            s = s.substring(index);

            // port
            String[] ipAndPort = host.split("\\:");
            if(ipAndPort.length > 1) {
                res += ipAndPort[0] + " " + ipAndPort[1] + " ";
            } else {
                res += host + " ";

                if(sch == "http") {
                    res += "80 ";
                } else {
                    res += "443 ";
                }
            }

            // path
            String[] pathAndQuery = s.split("\\?");
            if(pathAndQuery.length > 1) {
                res += pathAndQuery[0] + " " + pathAndQuery[1];
            } else {
                res += s;
            }

            System.out.println(res);

        }

        sc.close();
    }

    private static void m1() {
        Scanner sc = new Scanner(System.in);

        int num = Integer.valueOf(sc.nextLine());

        num = num % 50;
        long[] n = new long[num + 1];
        if(num == 0) {
            System.out.println(0);
            return;
        }

        n[0] = 0;
        n[1] = 1;

        for (int i = 2; i <= num; i++) {
            n[i] = n[i - 1] + 2 * n[i - 2];
        }
        System.out.println(n[num]);

        sc.close();
    }

    public static long cal(long num) {
        if(num % 50 == 0) {
            return 0;
        } else if(num % 50 == 1) {
            return 1;
        } else {
            return cal(num - 1) + 2 * cal(num - 2);
        }
    }
}
